package test;
import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.InfixtoPostfixTranslator;
import expression.PostfixEvaluator;


public class JasonFidukIPTest {

	@Before
	public void setUp() throws Exception {
		
	}

	@Test
	public void test1() {
		String postfix = InfixtoPostfixTranslator.eval("(  ( 5 * 2  ) - 1 ) /  3 ");
		assertTrue(postfix.equals("5 2 * 1 - 3 /"));
	}
	@Test
	public void test2() {
		String postfix = InfixtoPostfixTranslator.eval("20  / 10 +  2 * 15 /  5 ");
		assertTrue(postfix.equals("20 10 / 2 15 * 5 / +"));
	}
	@Test
	public void test3() {
		String postfix = InfixtoPostfixTranslator.eval("10  * 10  - 50 * 2  +  7");
		assertTrue(postfix.equals("10 10 * 50 2 * - 7 +"));
	}
	@Test
	public void test4() {
		String postfix = InfixtoPostfixTranslator.eval("(  50 -  25   + 5 - 25 ) * 7");
		assertTrue(postfix.equals("50 25 - 5 + 25 - 7 *"));
	}
	@Test
	public void test5() {
		String postfix = InfixtoPostfixTranslator.eval("10  / 5 * 8 - 10  / 2");
		assertTrue(postfix.equals("10 5 / 8 * 10 2 / -"));
	}

}
